﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace GameName1
{
    class GameStateInterlude : GameState
    {
        private double _creationTime;

        public GameStateInterlude(GameTime gameTime)
        {
            _creationTime = gameTime.TotalGameTime.TotalMilliseconds;
        }
        public override void Update(GameplayScene game, GameTime gameTime)
        {
            game.UpdateObjects(gameTime);

            game.CheckCollision(gameTime);
            game.DestroyByBoundary();

            if (GameplayScene.Lives == 0)
                ScreenManager.GetInstance().CurrentScreen = new GameOverScene(GameplayScene.Points);

            if(gameTime.TotalGameTime.TotalMilliseconds > _creationTime + 750)
            {              
                GameplayScene.GameState = new GameStateSpawningAngryAliens();
            }
        }
    }
}
